package com.guanyong.webapi.controllers.api;

import com.guanyong.model.HistoryTodayModel;
import com.guanyong.services.HistoryTodayService;
import com.guanyong.utils.Comm.ResultObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * Created by mxk on 2017/6/16.
 */
@RestController
@RequestMapping("/api/history/")
public class HistoryApi {

    @Autowired
    HistoryTodayService historyTodayService;

    //获取历史的今天
    @RequestMapping(value = "gethistorylist", method = RequestMethod.GET)
    public ResultObject<HashMap<String ,Object>> getHistoryList(
                                                    @RequestParam String date,
                                                    @RequestParam int pno,
                                                    @RequestParam int pagesize,
                                                    @RequestParam int allcount){
        ResultObject<HashMap<String ,Object>> resultObject=new ResultObject<HashMap<String,
                Object>>();

        HistoryTodayModel historyTodayModel=new HistoryTodayModel();
        historyTodayModel.setfDate(date);
        HashMap<String ,Object> hashMap= historyTodayService.GetHistoryTodayList
                (historyTodayModel,pno,
                pagesize,
                allcount);
        resultObject.setResult(hashMap);
        return  resultObject;
    }
}
